﻿using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using SmartCity.Shared;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;

namespace CommonManagement
{
    /// <summary>
    /// 新闻分类控制器
    /// </summary>
    [RemoteService]
    [Area("commonManagement")]
    [Route("api/commonManagement/categories")]
    public class CategoryController : AbpController, ICategoryAppService
    {
        private readonly ICategoryAppService _categoryAppService;

        public CategoryController(
            ICategoryAppService categoryAppService)
        {
            _categoryAppService = categoryAppService;
        }

        // 1.5.1 获取新闻分类
        [HttpGet]
        [Route("list")]
        public Task<ListResponse<CategoryDto>> PagedListAsync(PagedListRequest request)
        {
            return _categoryAppService.PagedListAsync(request);
        }
    }
}